from flask import request
from . import carbon_files_bp
from controller.carbon_files_controller import GetFilesUrl
from controller.users_controller import UserAuth
from controller.SearchapiController import SearchAPI
check_token = UserAuth.login_verify


@carbon_files_bp.route('/get_ids', methods=['POST'])
def get_ids():
    return GetFilesUrl.get_ids(request)


@carbon_files_bp.route('/get_url', methods=['POST'])
@check_token
def get_url():
    return GetFilesUrl.get_url(request)


@carbon_files_bp.route('/search', methods=['POST'])
def files_search():
    return SearchAPI.Searchapi(request)

# @carbon_files_bp.route('/test', methods=['POST'])
# def test_get():
#     return GetFilesUrl.test_get_file(request)
